<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button>点击</button>
<script>
    var btn = document.querySelector('button');
    var timer = setTimeout(function () {
        console.log('爆炸了')
    },3000)
    btn.addEventListener('click',function () {
        clearTimeout(timer);
    })
</script>
</body>
</html>